/********
 * AT 命令
 */
package com.yy.ttmodule.cardStatus;

public class Command {

    private int workerId;
    private String msg;
    private String response;
    private int reqId;
    
    public Command(int workerId,int reqId, String msg) {
        this.workerId = workerId;
        this.msg = msg;
        this.reqId = reqId;
    }
    
    public int getWorkerId() {
        return workerId;
    }
    
    public String getMsgString() {
        return msg;
    }
    
    public String toString() {
        return "workerId = " + workerId + ",msg = " + msg + ",reqId=" + reqId;
    }
    
    public void setResponse(String response) {
        this.response = response;
    }
    
    public String getResponse() {
        return response;
    }
    
    public int getReqId() {
        return reqId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if ((o == null) || (getClass() != o.getClass())) {
            return false;
        }

        Command that = (Command) o;

        if (workerId != that.workerId) {
            return false;
        }
        if (reqId != that.reqId) {
            return false;
        }

        if ((null == msg) && (null != that.msg)) {
            return false;
        } else if ((null != msg) && (null == that.msg)) {
            return false;
        } else if ((null != msg) && (!msg.equals(that.msg))) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int result = workerId;
        result = 31 * result + reqId;
        return result;
    }

}
